import java.util.Scanner;

public class Delete {
    public static void main(String[] args) {
        Scanner in=new Scanner(System.in);
       String[] ar=new String[]{"a","b","c","d","e"};
        for (String m:ar){
            System.out.print(m+" ");
        }
        System.out.println();
        System.out.print("输入要删除的:");
        String x=in.next();

       for (int a=0;a<ar.length;a++){
           if (ar[a].equals(x)){
               String n;
               ar[a]=null;
               for (int b=a;b<ar.length-1;b++){
                   n=ar[b];
                   ar[b]=ar[b+1];
                   ar[b+1]=n;
               }
            break;
           }
       }
       for (String m:ar){
           System.out.print(m+" ");
       }
    }
}
